/*
 * @Author: your name
 * @Date: 2021-05-15 20:56:55
 * @LastEditTime: 2021-07-11 21:11:13
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \led\ledtest.c
 */
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>


int main(int argc, char **argv)
{
    int fd;
    char* filename;
    char val;

    filename = argv[1];

    fd = open(filename, O_RDONLY);
    if (fd < 0)
    {
        printf("error, can't open %s\n", filename);
        return 0;
    }
	
    while (1)
    {
        read(fd,&val,1);

        printf("value = 0x%x\n",val);

        usleep(100000);
    }

    return 0;
}






